package ${configs.packagePath}.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import ${configs.packagePath}.aspect.annotation.Paging;
import ${configs.packagePath}.common.BaseServiceImpl;
import ${configs.packagePath}.pojo.${table.className};
import ${configs.packagePath}.service.${table.className}Service;
import com.github.pagehelper.Page;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <Description>
 * 实现
 * @author ${configs.author}
 * @version 1.0
 * @createDate ${date}
 * @see ${configs.packagePath}.service.impl
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ${table.className}ServiceImpl extends BaseServiceImpl<${table.className}> implements ${table.className}Service  {
    /**
     * 查询所有
     * @return
     */
    @Override
    public List<${table.className}> findAll() {
        return list();
    }

    /**
     * 根据ID查询
     * @param id
     * @return
     */
    @Override
    public ${table.className} findById(Integer id) {
        return getById(id);
    }

    /**
     * 添加
     * @param ${table.lowerName}
     * @return
     */
    @Override
    public boolean add(${table.className} ${table.lowerName}) {
        return save(${table.lowerName});
    }

    /**
     * 修改
     * @param ${table.lowerName}
     * @return
     */
    @Override
    public boolean updateById(${table.className} ${table.lowerName}) {
        return updateById(${table.lowerName});
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @Override
    public boolean deleteById(Integer id) {
        return removeById(id);
    }



    /**
     * 分页
     * @param page
     * @param size
     * @return
     */
    @Override
    public Page findPage(Integer page, Integer size) {
        return (Page) list();
    }


}
